﻿using System;
using System.Collections.Generic;
using DevExpress.Xpo;
using System.Text;

namespace BusinessObjects
{
    public class TaiKhoan : XPObject
    {
        public TaiKhoan()
            : base()
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public TaiKhoan(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place here your initialization code.
        }

        //Fields
        string fTenTaiKhoan = string.Empty;
        [Size(50)]
        public string TenTaiKhoan
        {
            get { return fTenTaiKhoan; }
            set { SetPropertyValue<string>("TenTaiKhoan", ref fTenTaiKhoan, value); }
        }
        string fMatKhau = string.Empty;
        [Size(50)]
        public string MatKhau
        {
            get { return fMatKhau; }
            set { SetPropertyValue<string>("MatKhau", ref fMatKhau, value); }
        }
        string fHo = string.Empty;
        [Size(50)]
        public string Ho
        {
            get { return fHo; }
            set { SetPropertyValue<string>("Ho", ref fHo, value); }
        }
        string fTen = string.Empty;
        [Size(50)]
        public string Ten
        {
            get { return fTen; }
            set { SetPropertyValue<string>("Ten", ref fTen, value); }
        }
        bool fQuanTri;
        public bool QuanTri
        {
            get { return fQuanTri; }
            set { SetPropertyValue<bool>("QuanTri", ref fQuanTri, value); }
        }
        [Association(@"PhanQuyenReferencesTaiKhoan", typeof(PhanQuyen))]
        public XPCollection<PhanQuyen> PhanQuyens { get { return GetCollection<PhanQuyen>("PhanQuyens"); } }
        [Association(@"TestUserReferencesTaiKhoan", typeof(TestUser))]
        public XPCollection<TestUser> TestUsers { get { return GetCollection<TestUser>("TestUsers"); } }
    }
}
